#include "stdint.h"
#include "gpio.h"
#include "spi.h"
#include "mpu6500_reg_h.h"

#define MPU_NSS_LOW HAL_GPIO_WritePin(GPIOC,IMU_NSS_Pin,GPIO_PIN_RESET);
#define MPU_NSS_HIGH HAL_GPIO_WritePin(GPIOC,IMU_NSS_Pin,GPIO_PIN_SET);
static void MPU6500_Delay(void);

struct IMU_data
{
	int16_t ax,ay,az,gx,gy,gz,temp,
	         ax_offset,ay_offset,
	         gx_offset,gy_offset,gz_offset;
	uint32_t az_offset;
	float wx,wy,wz,roll,pitch,yaw;
};
 
extern uint8_t tx,rx,id;


//static void MPU6500_Delay(void);
uint8_t mpu_write_byte(uint8_t const reg, uint8_t const data);
uint8_t mpu_read_byte(uint8_t const reg);
uint8_t mpu_device_init(void);
float Get_16Bit_Data(uint8_t addr_h, uint8_t addr_l);
void Get_MPU6500_Data(void);
void MPU6500_Init(void);
uint8_t mpu_set_accel_fsr(uint8_t fsr);
uint8_t mpu_set_gyro_fsr(uint8_t);
void mpu_offset_call(void);
